#ifndef THREAD_H
#define THREAD_H


#pragma once
#pragma comment( linker, "/defaultlib:ws2_32.lib" )
#include <winsock2.h>
#include <ws2tcpip.h>
#include <process.h>
#include <winsock.h>
#include <iostream>
#include <windows.h>
#include <sstream>
#include <string>
#include <fstream>
#include <stdio.h>
#include <vector>
#include <iterator>

//port data types
#define REQUEST_PORT 0x7070

class TcpServer{
private:
	char * buffer;
	HANDLE test;
	DWORD dwtest;
	char localhost[11];		//host data types
	HOSTENT *hp;
	SOCKET s;				//socket data types
	SOCKET s1;
	SOCKADDR_IN sa;			// filled by bind
	int port = REQUEST_PORT;
	fd_set readfds;
	int outfds = 0;
	int infds = 1;
	struct timeval timeout;
	const struct timeval *tp = &timeout;
	union {
		struct sockaddr generic;
		struct sockaddr_in ca_in;
	}ca;
	int calen = sizeof(ca);
public:
	TcpServer();
	virtual ~TcpServer();
	void start();
};

#endif